/* data consumer interface for mapping data to GUI automaticly */

jsx3.lang.Class.defineInterface(
	"ux.cdb.admin.dataautomate.IDataExtractor",
	null,
	function(plugin, plugin_prototype) {

		plugin_prototype.extractData = jsx3.lang.Method.newAbstract("data");

		plugin_prototype.registerExtractor = function(mode) {
			if(!this.provider) {
				this.provider = this.findAncestor(function(obj){return obj.instanceOf("ux.cdb.admin.dataautomate.IDataProvider");},false);
			}
			if(this.provider){
				this.provider.unregisterExtractor(this);
				this.provider.registerExtractor(this);
			}
		};

		plugin_prototype.unregisterExtractor = function() {
			if(!this.provider) {
				this.provider = this.findAncestor(function(obj){return obj.instanceOf("ux.cdb.admin.dataautomate.IDataProvider");},false);
			}
			if(this.provider){
				this.provider.unregisterExtractor(this);
			}
		};

		plugin_prototype.setExtractDataAttributeName = function(val){
			this.uxextdataatt = val;
		};
		
		plugin_prototype.getExtractDataAttributeName = function(){
			return this.uxextdataatt;
		};
		
		plugin_prototype.getValidator = function(){
			return this.uxvalidator;
		};
		
		plugin_prototype.setValidator = function(val){
			this.uxvalidator = val;
		};
		
		plugin_prototype.getValidatorParams = function(){
			return this.uxvalidatorparams;
		};
		
		plugin_prototype.setValidatorParams = function(val){
			this.uxvalidatorparams = val;
		};
			
		plugin_prototype.getData = function() {
			return this.extractData();
		};


	});